package cn.platform.controller;

import cn.platform.response.AResponse;
import cn.platform.service.HarmonyActivityHomeworkService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@CrossOrigin(maxAge = 3600) //允许跨域请求
@Controller
@RequestMapping("/api/activity-homework")
public class HarmonyActivityHomeworkController {
    @Resource
    HarmonyActivityHomeworkService harmonyActivityHomeworkService;

    /**
     * 根据用户所在班级查询用户班级活动
     *
     * @param classId 班级id
     * @return AResponse res 班级活动
     * @author jyz
     */
    @GetMapping("/get-activity-homework")
    @ResponseBody
    public AResponse listClassActivity(String classId, String type){
        return harmonyActivityHomeworkService.getActivityOrHomework(classId, type);
    }
}
